package com.guigu.tms.commons.dispatch.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.guigu.tms.commons.order.entity.Order;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 订单分类记录
 * </p>
 *
 * @author zwj
 * @since 2022-10-19
 */
@TableName("pd_order_classify")
@Data
public class OrderClassify implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    private String id;

    /**
     * 任务id
     */
    private String jobId;

    /**
     * 任务日志id
     */
    private String jobLogId;

    /**
     * 起始机构
     */
    private String startAgencyId;

    /**
     * 结束机构
     */
    private String endAgencyId;

    /**
     * 订单类别:xxx#xxx#xxx
     */
    private String classify;

    /**
     * 订单数量
     */
    private Integer total;

    /**
     * 创建时间
     */
    private LocalDateTime createDate;

    @TableField(exist = false)
    private List<Order> orders;

    @TableField(exist = false)
    private String currentAgencyId;

    public boolean isNew(){
        return this.startAgencyId.equals(this.currentAgencyId);
    }

}
